//
//  ByAboutUsVC.m
//  caipiao_ios
//
//  Created by mc on 2018/8/8.
//  Copyright © 2018年 ZhangZhanbin. All rights reserved.
//

#import "ByAboutUsVC.h"

@interface ByAboutUsVC ()

@end

@implementation ByAboutUsVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self addLeftBackBarButtonItem];
    self.title = @"关于我们";
    [self initViews];
    // Do any additional setup after loading the view.
}

- (void)initViews{
    self.view.backgroundColor = rgba(246, 246, 246, 1);
    
    
    UIImageView *iconView = [[UIImageView alloc] init];
    [self.view addSubview:iconView];
    [iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(30);
        make.centerX.equalTo(self.view).offset(0);
        make.size.mas_equalTo(CGSizeMake(57, 57));
    }];
    iconView.image = [UIImage imageNamed:@"guanyuwomen"];
    
    UILabel *titleLabel = [[UILabel alloc] init];
    [self.view addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(10);
        make.right.equalTo(self.view).offset(-10);
        make.top.equalTo(iconView.mas_bottom).offset(13);
        make.height.mas_equalTo(@16);
    }];
    titleLabel.textColor = [UIColor blackColor];
    titleLabel.text = @"彩票";
    titleLabel.font = FONT(14);
    titleLabel.textAlignment = NSTextAlignmentCenter;
    
    
    UIView *backgroundView = [[UIView alloc] init];
    [self.view addSubview:backgroundView];
    [backgroundView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(0);
        make.right.equalTo(self.view).offset(0);
        make.top.equalTo(titleLabel.mas_bottom).offset(23);
        make.height.mas_equalTo(@60);
    }];
    backgroundView.backgroundColor = [UIColor whiteColor];
    
    
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom).offset(-38);
        make.centerX.equalTo(self.view).offset(0);
        make.size.mas_equalTo(CGSizeMake(100, 15));
    }];
    [btn setTitle:@"《服务协议》" forState:UIControlStateNormal];
    [btn setTitleColor:BY_THEME_COLOR forState:UIControlStateNormal];
    btn.titleLabel.font = FONT(13);
    [btn addTarget:self action:@selector(btnAction:) forControlEvents:UIControlEventTouchUpInside];
    
}

- (void)btnAction:(UIButton *)btn{
    
    ByWebViewController *vc = [[ByWebViewController alloc] initWithTotalUrlString:[NSString stringWithFormat:@"%@/Wanfajiesao/service?type=0",BOYE_WEB_BASE_URL]];
    vc.titleString = @"服务协议";
    [self by_normalPush:vc hasNavi:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
